﻿/* 2. Write a program that shows the sign (+ or -) of the product of three real numbers without calculating it. 
 * Use a sequence of if statements. */

using System;

public class SignOfProduct
{
    public static void Main()
    {
        double first, second, third;
        bool isPositiveProduct = true;

        Console.Write("First number = ");
        first = double.Parse(Console.ReadLine());
        Console.Write("Second number = ");
        second = double.Parse(Console.ReadLine());
        Console.Write("Third number = ");
        third = double.Parse(Console.ReadLine());
        Console.WriteLine("------------");

        if ((first == 0) || (second == 0) || (third == 0))
            Console.WriteLine("The product of these numbers is 0.");
        else
        {
            if (first < 0)
                isPositiveProduct = (!isPositiveProduct);

            if (second < 0)
                isPositiveProduct = (!isPositiveProduct);

            if (third < 0)
                isPositiveProduct = (!isPositiveProduct);

            if (isPositiveProduct)
                Console.WriteLine("The sign of the product of these numbers is +.");
            else
                Console.WriteLine("The sign of the product of these numbers is -.");
        }
    }
}